<template>
	<view class="tabs" style="margin: 0 4rpx;">
		<button type="primary" size="mini"  @click="addQingJia">请假新增</button>
		<view class="line-h"></view>
		<uni-section class="tabs" title="请假列表" type="line">
			<uni-collapse >
				<uni-collapse-item v-for="(val,key) in wxLeaveList" :key="key" :title="key" :show-animation="true">
					<view class="content">
						<template v-for="(val1,key1) in val">
							<view class="tag-view" v-for="(val2,key2) in val1">
								<view style="text-align: center;">{{key1}}.{{key2}}</view>
								<template v-for="(val3,key3) in val2">
									<uni-tag  type="primary" :inverted="true" style="margin-left: 2rpx;margin-bottom: 2rpx;" @click="handleDate"  :text="val3.leaveDateDay" :key="val3.leaveId"></uni-tag>
								</template>
							</view>
						</template>
					</view>
				</uni-collapse-item>
				
			</uni-collapse>
		</uni-section>
	</view>
</template>

<script>
	import {doNavigatePage} from '@/js/navigatePage'
	import {AddLeaveUrl} from '@/js/constant'
	import {getWxLeaveList} from '@/js/api/leaveApi'
	export default {
		name: 'Leave',
		data() {
			return {
				wxLeaveList:{}
			}
		},
		mounted() {
			this.getWxLeaveList()
		},
		methods: {
			addQingJia(){
				doNavigatePage(AddLeaveUrl);
			},
			async getWxLeaveList(){
				
				let list = await getWxLeaveList({})
				this.wxLeaveList = list.data
				console.log('getWxLeaveList',list)
			},
			handleDate(){
				uni.showToast({
					title: '请LLL',
					icon: 'none'
				})
			}
		}
	}
</script>

<style>


</style>
